--[[
	Exsto
	Copyright (C) 2010  Prefanatic

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
]]


local function PrintLoading( srvVer )
	print( [[.
-----------------------------------------
---        Exsto by Prefanatic        ---
---	  Minecraft Edition :OO       ---
---            ]] .. "Revision " .. tostring( exsto.VERSION ) .. [[           ---
--- Please ignore all modules errors. ---
-----------------------------------------
]] )

end

local function LoadVariables( srvVer )

	exsto = {}
	exsto.DebugEnabled = true
	--exsto.StartTime = SysTime()
	
	exsto.VERSION = 100
end

function exstoInclude( fl )
	print( "[Exsto] Including --> " .. fl )
	dofile( "lua/Exsto/" ..fl )
end

function exstoInit( srvVer )
	
	if exsto then
		if exsto.Print then
			exsto.Print( exsto_CHAT_ALL, COLOR.EXSTO, "Exsto", COLOR.NORM, " is reloading the core!" )
		end
		if exsto.Plugins and exsto.RemoveChatCommand then
			exsto.UnloadAllPlugins()
		end
	end			
	
	LoadVariables( srvVer )
	PrintLoading( srvVer )
	
	exstoInclude( "exsto/sv_init.lua" )

end

exstoInit()

--[[concommand.Add( "_ExRestartInitSpawn", function( ply, _, args )
	hook.Call( "ExInitSpawn", nil, ply, ply:SteamID(), ply:UniqueID() )
	hook.Call( "exsto_InitSpawn", nil, ply, ply:SteamID(), ply:UniqueID() )
end )]]